package net.oschina.app.cwq;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import net.oschina.app.R;
import net.oschina.app.util.UIUtils;

/**
 * Created by Admin on 2017/7/16.
 */

public class MainAdapter extends FragmentPagerAdapter{

    String[] titles=null;

    public MainAdapter(FragmentManager fm) {
        super(fm);
        titles= UIUtils.getStrings(R.array.content_title);

    }

    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
